package pratap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.DynaValidatorForm;

public class SearchcontactAction extends Action
{

public ActionForward execute(ActionMapping mapping, ActionForm form,
		HttpServletRequest request, HttpServletResponse response)
		throws Exception {
System.out.println("SearchcontactAction()");
String result="SearchResult";

DynaValidatorForm dyf=(DynaValidatorForm)form;
String em=dyf.get("email").toString();

System.out.println(em);
ContactTO cto=new ContactTO();
cto.setFname("shyam");
cto.setLname("Singh");
cto.setEmail(em);
cto.setPhone("123457");

HttpSession sess=request.getSession();
sess.setAttribute("CTO", cto);
sess.setAttribute("EDIT", "FALSE");


	return mapping.findForward(result);
}
}
